import jieba.posseg as pseg
# words = pseg.cut("我爱北京天安门")
file = '../data/4.16新浪新闻数据/text0.txt'
# text = open(file, encoding='utf-8')
#
# line = text.readline()
# print(line)
with open(file, encoding='utf-8') as file_obj:
    line = file_obj.readline()

    while line:
        print(line)
        words = pseg.cut(line)
        sen = {}
        for word, flag in words:
            sen.update({word: flag})
        print(sen)

        line = file_obj.readline()

